<template>
	<view class="main">
		<view class="search_box">
			<view class="search">
				<view class="search_left">
					<view class="p-l-24">
						<u-image :src="searchIcon" width="40rpx" height="40rpx"></u-image>
					</view>
					<view class="search_tips">
						<u-input v-model="search" placeholder="请输入关键词" :clearable="true" :trim="true" :border="false"
							placeholder-style="color: #CCCCCC" />
					</view>
				</view>
			</view>
			<view class="search_right" @click="action">
				<u-image :src="searchRight" width="74rpx" height="74rpx"></u-image>
			</view>
		</view>
		<u-popup v-model="ShowAction" mode="bottom" :closeable="true">
			<view class="pop_content">
				<view class="box">
					<view class="left" @click="actSel(1)">
						<view class="">
							<u-image :src="mark" width="160rpx" height="160rpx"></u-image>
						</view>
						<view class="m-t-20" >
							批量打标签
						</view>
					</view>
					<view class="right" @click="actSel(2)">
						<view class="">
							<u-image :src="doc" width="160rpx" height="160rpx"></u-image>
						</view>
						<view class="m-t-20">
							批量导出
						</view>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	//@mySearch  //搜索词
	//@navAction  //批量动作
	export default {
		data() {
			return {
				search: '',
				searchIcon: require('@/static/img/search@2x.png'),
				searchRight: require('@/static/icon/search_right.png'),
				doc: require('@/static/img/doc.png'),
				mark: require('@/static/img/mark.png'),
				ShowAction:false
			}
		},
		watch: {
			search(val) {
				this.$emit('mySearch', this.search)
			}
		},
		methods: {
			action(){
				this.ShowAction = true
			},
			actSel(num){
				if(num == 1){
					this.$emit('navAction','批量打标签')
				}else{
					this.$emit('navAction','批量导出')
				}
				this.ShowAction = false
			},
		},
	}
</script>

<style lang="scss" scoped>
	.main {

		//background-color: #F8F8F8;
		.search_box {
			width: 100%;
		//	padding: 0 24rpx;
			// position: fixed;
			// z-index: 2;
			background-color: #FFFFFF;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 10px;
			.search {
				//margin: 0 24rpx;
				margin: 20rpx 0;
				width: 100%;
				height: 74rpx;
				border-radius: 200rpx;
				border: 1px solid #4DC0D9;
				display: flex;
				align-items: center;
				justify-content: space-between;
				.search_left {
					flex: 1;
					display: flex;
					align-items: center;
					//justify-content: space-between;
					.search_tips {
						width: 100%;
						padding-left: 10rpx;
						//padding-right: 20px;
					}
				}
			}

			.search_right {
				padding-left: 10px;
			}
		}
		.pop_content{
			border-radius: 30rpx;
			.box{
				display: flex;
				justify-content: space-around;
				align-items: center;
				margin-top: 152rpx;
				padding-bottom: 172rpx;
				font-weight: bold;
				font-size: 30rpx;
				color: #333333;
				line-height: 35rpx;
				text-align: center;
				.left{
					display: flex;
					flex-direction: column;
					align-items: center;
				}
				.right{
					display: flex;
					flex-direction: column;
					align-items: center;
				}
			}
		}
	}
</style>